package com.qys.livesMall.system.controller.app;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qys.livesMall.common.result.R;
import com.qys.livesMall.framework.view.BaseQuery;
import com.qys.livesMall.system.modal.vo.HomeBannerTypeVO;
import com.qys.livesMall.system.model.vo.app.AppHomeBannerVo;
import com.qys.livesMall.system.service.IH2AppHomeBannerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 首页轮播图 前端控制器
 * </p>
 *
 * @author dp
 * @since 2023-05-02
 */
@RestController
@RequestMapping("/app/home/banner")
@Tag(description = "app-首页轮播图", name = "AppHomeBannerController")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class AppHomeBannerController {

    private final IH2AppHomeBannerService homeBannerService;

    @PostMapping("/list")
    @Operation(description = "分页查询轮播图信息")
    public R<List<AppHomeBannerVo>> listByApp() {
        return R.ok(homeBannerService.listByApp());
    }

    @GetMapping("/{id}")
    @Operation(description = "根据id查询活动详情")
    public R<AppHomeBannerVo> queryById(@PathVariable Long id) {
        return R.ok(homeBannerService.queryById(id));
    }

}
